package com.lianxi.Courses.service;

import com.github.pagehelper.PageInfo;
import com.lianxi.Courses.entity.Resource;
import com.lianxi.Courses.entity.User;
import com.lianxi.Courses.entity.UserResource;
import com.lianxi.Courses.exception.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpSession;
import java.io.File;
import java.util.List;


/**
 * 翔哥
 * 2025年10月14日
 */
public interface UserResourceService {

    //我买的资源
    PageInfo<UserResource> findPage(String userId,String pageNo, String pageSize);

    //我上传的资源
    PageInfo<Resource> findMy(String userId, String pageNo, String pageSize);

    Resource findById(String id);

    //修改
    void updateByRe(String id,String title ,CommonsMultipartFile file , String costType, String costNumber, HttpSession session) throws RequestParameterErrorException, FileUploadErrorException, ResourceErrorException;

    //添加
    void addByRe(String title ,CommonsMultipartFile file , String costType, String costNumber, HttpSession session) throws RequestParameterErrorException, FileUploadErrorException, ResourceErrorException;

    //删除
    void deleteByRe(String id, HttpSession session) throws RequestParameterErrorException;

    //判断买了当前资源没有

    boolean yesOrNo(String userId,String resourceId) throws RequestParameterErrorException;
    //买资源
    void addBuyResource(String userId,String resourceId,HttpSession session) throws RequestParameterErrorException, UserResourceErrorException, GoldPointsErrorException;
}
